From: Karl Heuer Date: Tue, 19 Apr 1994 05:52:58 +0000 (+0000) Subject: (read_avail_input): Write loop as a do-while. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~92099 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=9134775b88c462d5fbf4c0c33a1af806f562343c;p=emacs.git (read_avail_input): Write loop as a do-while. --- diff --git a/src/keyboard.c b/src/keyboard.c index 434d019c6e0..affd373655b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -3339,7 +3339,7 @@ read_avail_input (expected) /* Now read; for one reason or another, this will not block. NREAD is set to the number of chars read. */ - while (1) + do { #ifdef MSDOS cbuf[0] = dos_keyread(); @@ -3356,17 +3356,15 @@ read_avail_input (expected) kill (0, SIGHUP); #endif /* Retry the read if it was interrupted. */ - if (nread >= 0 - || ! (errno == EAGAIN + } + while (nread < 0 && (errno == EAGAIN #ifdef EFAULT - || errno == EFAULT + || errno == EFAULT #endif #ifdef EBADSLT - || errno == EBADSLT + || errno == EBADSLT #endif - )) - break; - } + )); #ifndef FIONREAD #if defined (USG) || defined (DGUX)